var angular = require('angular');
require('angular-animate');
require('angular-cookies');
require('angular-bootstrap');
require('angular-resource');
require('angular-sanitize');
require('angular-touch');
require('ngstorage');
require('angular-ui-router');
require('angular-ui-tree');

require('angular-file-upload');

// require('eonasdan-bootstrap-datetimepicker');
require('angular-eonasdan-datetimepicker');

require('ui-select');
require('../node_modules/ui-select/dist/select.min.css');


require('./998mstp/js/services/ui-load');
require('./998mstp/js/directives/ui-jq');
require('./998mstp/js/directives/ui-validate');

require('./998mstp/js/directives/ui-nav');
require('./998mstp/js/directives/setnganimate');
require('./998mstp/js/directives/ui-butterbar');
require('./998mstp/js/directives/ui-focus');
require('./998mstp/js/directives/ui-fullscreen');
require('./998mstp/js/directives/ui-module');
require('./998mstp/js/directives/ui-scroll');
require('./998mstp/js/directives/ui-shift');
require('./998mstp/js/directives/ui-toggleclass');
require('./998mstp/js/controllers/bootstrap');
require('./998mstp/js/filters/fromNow');

require('angular-translate');
require('oclazyload');
require('angular-datatables');

// ------------ 颜色拾取 ----------------------//
// require('./998mstp/js/minicolors/jquery.minicolors');
// require('./998mstp/js/minicolors/jquery.minicolors.css');
// require('./998mstp/js/minicolors/jquery.minicolors.png');
// require('angular-minicolors');
// ------------ 颜色拾取 ----------------------//

// ------------ 百度富文本编辑器 ----------------------//
window.UEDITOR_HOME_URL = 'ueditor/';
require('../node_modules/angular-ueditor/dist/angular-ueditor');
// ------------ 百度富文本编辑器 ----------------------//

// ------------ 富文本编辑器 ----------------------//
//require('../node_modules/textangular/dist/textAngular-rangy.min');
require('../node_modules/textangular/dist/textAngular-sanitize.min');
require('../node_modules/textangular/dist/textAngular.min');
require('../node_modules/textangular/dist/textAngular.umd');
require('../node_modules/textangular/dist/textAngularSetup');
require('../node_modules/textangular/dist/textAngular.css');
// ------------ 富文本编辑器 ----------------------//


// ------------ 图表 ----------------------//
require('../node_modules/angular-chart.js/dist/angular-chart.min');
//require('../node_modules/angular-chart.js/dist/angular-chart.min.css');
// ------------ 图表 ----------------------//


// ------------ angular tree ----------------------//
require('../node_modules/angular-tree-control/angular-tree-control');
require('../node_modules/angular-tree-control/css/tree-control.css');
require('../node_modules/angular-tree-control/css/tree-control-attribute.css');
// ------------ angular tree ----------------------//

// ------------ 弹出框 ----------------------//
require('angularjs-toaster');
require('../node_modules/angularjs-toaster/toaster.min.css');
// ------------ 弹出框 ----------------------//


require('angular-drag');


//require('./998mstp/css/bootstrap.css');
require('./998mstp/vendor/jquery/datatables/dataTables.bootstrap.css');
//require('./998mstp/css/font-awesome.min.css');
require('./998mstp/css/simple-line-icons.css');
require('./998mstp/css/font.css');
// require('./998mstp/css/app.css');


require('../node_modules/angular-ui-tree/dist/angular-ui-tree.css');


require('./00pageframework/app');
require('./01dashboard/app');
require('./02product/app');
require('./03person/app');
require('./04permission/app');
require('./05login/app');
require('./06view/app');
require('./07tickettype/app');
require('./08channelTemp/app');
require('./09goodsTemp/app');
require('./10goods/app');
require('./11order/app');
require('./12device/app');
require('./13deposit/app');
require('./14line/app');
require('./15interface/app');
require('./16guide/app');
require('./17module/app');
require('./18menu/app');
require('./19system/app');
require('./20office/app');
require('./21dict/app');
require('./22area/app');
require('./23user/app');
require('./24redpacket/app');
require('./25role/app');
require('./26ylb/app'); // 商客组,马超群,葫芦岛游乐宝
require('./27equipment/app') 
require('./28customservice/app');
require('./29product/app');
require('./30store/app');
require('./31sign/app');
require('./32ticket/app');
require('./33sale/app');
require('./34statistics/app');
require('./35card/app');
require('./36docking/app');
require('./36log/app');
require('./37linestatistics/app');//lc线路统计
require('./38expert_review/app');//专家评审
require('./39coupon/app');//优惠券
require('./40eventtask/app');//事件-任务 DHpai
require('./41attractTourist/app');//招徕奖励系统 DHpai
require('./42examineRoster/app');//名单审核系统 DHpai
require('./43packageRole/app');//套餐服务 DHpai
require('./44subsidycount/app');//补贴统计 DHpai
require('./45shangke/app'); // 商客组,马超群,商客大部分功能
require('./46skstore/app'); // 商客组,马超群,商客商户模块
require('./47notice/app');
require('./49shangkeexpand/app'); // 商客
require('./50bussmember/app'); // 商户会员
require('./51weshop/app');//微店，dlq，微店功能
require('./52hldWX/app');//小裙子 葫芦岛微信 53enterpriserecord
require('./54enterpriserecord/app');//小裙子 旅游企业备案系统 
require('./55skwx/index');//马林 新商客微信
require('./53electronicfence/app');//杨志宇 电子围栏管理
require('./56trackafter/app');//杨志宇 游团轨迹跟踪
require('./58view_review/app');//李某 景区A级评定系统
require('./60viewSystem/app'); // 景区会员
require('./61activity/app'); // 活动
require('./62film/app'); // 影院
require('./63voluntourism/app'); // 公益游
require('./64peopen/app'); // 旅游企业公示曝光
require('./65tourinsurance/app'); // 游团保险复核
require('./67doc/app'); // 文档
require('./68counseling/app'); // 旅游业务咨询服务系统
require('./69createcity/app'); // 创城办系统

require('./70hoteltype/app');//酒店房型
require('./72touristfunds/app');//企业资金管理 孙某
require('./73tourismexamine/app');//旅游企业备案系统
require('./74tourismplanning/app');//旅游企业备案系统
require('./77tourism_product_grade_estimation/app');//产品等级评定系统
require('./80projectplanning/app');//项目规划系统
require('./90facediscern/app');//景区流量监控系统
require('./91dataanalysis/app');//大数据分析系统
require('./92satisfaction/app');//企业满意度评价
require('./93community/app');//社区便民服务

require('./80projectplanning/app');//项目规划系统 孙某
require('./88hotel_review/app');//酒店星级评定系统 孙某
require('./89sincerity_review/app');//诚信经营评定系统 孙某
//require('./994intercept/app');
require('./992test/app');
require('./994directive/app');
require('./995util/app');
require('./996tpl/app');
require('./997test/app');


require('./00pageframework/css/app.css');



//=================[ 权限模块加载 ]===========================//

(require('./04permission/boot'))(jQuery);

//=================[ 权限模块加载 ]===========================//




var juyou = angular.module('app', [
    // 'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngSanitize',
    'ngTouch',
    'ngStorage',
    'ui.router',
    'ui.tree',
    'ui.bootstrap',
    'ui.load',
    'ui.jq',
    'ui.validate',
    'ui.nav',
    'oc.lazyLoad',
    'pascalprecht.translate',

    'fromnow',
    'setnganimate',
    'ui.butterbar',
    'ui.focus',
    'ui.fullscreen',
    'ui.module',
    'ui.scroll',
    'ui.shift',
    'ui.select',
    'ui.toggleclass',
    'ctrl.bootstrap',

    'datatables',
    'datatables.bootstrap',
    'datatables.tabletools',
    'datatables.colvis',
    'datatables.light-columnfilter',
    'datatables.columnfilter',

    'chart.js',
    'textAngular',
    'treeControl',
    'angularFileUpload',
    'ng.ueditor',
    'toaster', 
    'angular-drag',

    'pageframework',
    'dashboard',
    'productOld',
    'person',
    'permission',
    'login',
    'view',
    'tickettype',
    'channelTemp',
    'goodsTemp',
    'goods',
    'order',
    'device',
    'deposit',
    'interface',
    'system',
    'module',
    'menu',
    'office',
    'dict',
    'area',
    'user',
    'role',
    'ylb',
    'line',
    'redpacket',
    'equipment',
    'product',
    'custs',
    'store',
    'sign',
    'log',
    'shangke',
    'skstore',
    'shangkeexpand',
    'ticket',
    'notice',
    'sale',
    'statistics',
    'eventtask',
    'attractTourist',
    'examineRoster',
    'packageRole',
    'subsidycount',
    'activitySystem',
    'testSystem',
    'guide',
    'directive',
    'util',
    'juyoutpl',
    'test', 
     'card',
     'docking',
    'ae-datetimepicker',
     //线路统计
    'linestatistics',
    //专家评审
    'expert_review',
    'coupon',
    'bussmember',
    'viewSystem',
    'film',
    'voluntourism',
    'peopen',
    'tourinsurance',
    'doc',//文档
    'counseling',//旅游业务咨询服务系统
    'createcity',//创城办
    'weshop',
    'hldWX',
    'enterpriserecord',
    'skwx',
    // 'hotel',
    //酒店房型
    'hoteltype',

    'touristfunds',

    
    'dataanalysis',//大数据分析系统
    // 景区A级评定系统
    'view_review',
    // 旅游企业备案系统
    'tourismexamine',
    'projectplanning',
    'tourismplanning', // 旅游规划评审系统
    'tourism_product_grade_estimation', // 产品等级评定系统
    //'ae-datetimepicker',
    'electronicfence',
    'trackafter',//轨迹跟踪
    'facediscern',//流量监控
    'sincerity_review',//诚心经营
    'hotel_review',
    'satisfaction',
    'community',

    'trackafter'

]);



juyou.config(require('./config'));
juyou.constant('JQ_CONFIG',require('./config.jq'));
juyou.constant('CONST',require('./config.const'));
juyou.config(require('./config.lazyLoad'));
juyou.run(require('./config.run'));
juyou.controller('AppCtrl', require('./main'));

juyou
//html过滤器
//用法<p class="form-control-static" ng-bind-html="viewobj.book_info | trustHtml"/>
.filter('trustHtml', function ($sce) {
    return function (input) {
        return $sce.trustAsHtml(input);
    }
})


juyou.factory('selectMenu', ['$rootScope', function ($rootScope) {
    // 定义所要返回的地址对象   
    var menu = {};
    menu.changeMenu = function (value) {
        menu.value = value;
        $rootScope.$broadcast('changeMenu');
    };
    return menu;
}]);



juyou.directive('imageonload', function () {
  return {
    restrict: 'A', link: function (scope, element, attrs) {
      element.bind('load', function () { 
        //call the function that was passed 
        scope.$apply(attrs.imageonload);
      });
    }
  };
})

